﻿<UserControl xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             mc:Ignorable="d" 
             x:Class="SCADAServis.Controls.ganttItemUC"
d:DesignWidth="157" Cursor="Hand" Height="33">
    <UserControl.Resources>
        <Style x:Key="ToolTipStyle" TargetType="ToolTip">
            <!--<Setter Property="OverridesDefaultStyle" Value="true"/>-->
            <!--<Setter Property="HasDropShadow" Value="True"/>-->
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="ToolTip">
                        <Border x:Name="Border" BorderBrush="Gray"  BorderThickness="1.8,1,1,1"  Width="{TemplateBinding Width}" Height="{TemplateBinding Height}">
                            <Border.Background>
                                <LinearGradientBrush Opacity=".8">
                                    <GradientStop Color="White"  Offset="0"/>
                                    <GradientStop Color="Silver" Offset="2"/>
                                </LinearGradientBrush>
                            </Border.Background>
                            <ContentPresenter
            Margin="4" 
            HorizontalAlignment="Left"
            VerticalAlignment="Top" />
                        </Border>
                        <!--<ControlTemplate.Triggers>
                            <Trigger Property="HasDropShadow" Value="true">
                                <Setter TargetName="Border" Property="SnapsToDevicePixels" Value="true"/>
                            </Trigger>
                        </ControlTemplate.Triggers>-->
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
    </UserControl.Resources>
    <UserControl.Triggers>
        <EventTrigger RoutedEvent="FrameworkElement.Loaded"/>
    </UserControl.Triggers>
    <ToolTipService.ToolTip>
        <StackPanel>
            <TextBlock FontSize="17" x:Name="ttCaption"/>
            <StackPanel Orientation="Horizontal">
                <TextBlock Margin="0,0,4,0" ><Run Text="od"/></TextBlock>
                <TextBlock FontWeight="bold" Margin="0,0,10,0" x:Name="ttFrom"/>
                <TextBlock Margin="0,0,4,0"><Run Text="do"/></TextBlock>
                <TextBlock FontWeight="bold" x:Name="ttTo"/>
            </StackPanel>
            <ListBox x:Name="ttData" BorderThickness="0">
                <ListBox.ItemTemplate>
                    <DataTemplate>
                        <StackPanel Orientation="Horizontal">
                            <TextBlock Text="{Binding Name}"/>
                            <TextBlock Text="{Binding Value}"/>
                        </StackPanel>
                    </DataTemplate>
                </ListBox.ItemTemplate>
            </ListBox>
        </StackPanel>
    </ToolTipService.ToolTip>
    <Grid>
        <VisualStateManager.VisualStateGroups>
            <VisualStateGroup x:Name="VisualStateGroup">
            	<VisualStateGroup.Transitions>
            		<VisualTransition GeneratedDuration="0:0:0.3"/>
            	</VisualStateGroup.Transitions>
                <VisualState x:Name="IsMouseIn">
                    <Storyboard>
                        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="border1">
                        	<SplineDoubleKeyFrame KeyTime="0" Value="1"/>
                        </DoubleAnimationUsingKeyFrames>
                        <ColorAnimationUsingKeyFrames Storyboard.TargetProperty="(Panel.Background).(SolidColorBrush.Color)" Storyboard.TargetName="border1">
                        	<SplineColorKeyFrame KeyTime="0" Value="#FF1C2349"/>
                        </ColorAnimationUsingKeyFrames>
                        <DoubleAnimation Duration="0" To="0.53" Storyboard.TargetProperty="(UIElement.Effect).(DropShadowEffect.Opacity)" Storyboard.TargetName="brd" d:IsOptimized="True"/>
                    </Storyboard>
                </VisualState>
                <VisualState x:Name="IsMouseOut"/>
            </VisualStateGroup>
        </VisualStateManager.VisualStateGroups>
        <Border x:Name="brd" Margin="1" Background="White"  >
            <Border.Effect>
                <DropShadowEffect BlurRadius="25" Opacity="0" ShadowDepth="0"/>
            </Border.Effect>
        </Border>
        <Border x:Name="border" BorderBrush="Black" BorderThickness="1" Background="White">
            <Grid>
            	<Grid.RowDefinitions>
            		<RowDefinition Height="auto"/>
            		<RowDefinition Height="*"/>
            	</Grid.RowDefinitions>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="Auto" />
                    <ColumnDefinition Width="*"/>
                    <ColumnDefinition Width="Auto"/>
                </Grid.ColumnDefinitions>
                <TextBlock FontSize="21.333" Grid.Column="0" Margin="1,3,0,0" x:Name="lLeft" HorizontalAlignment="Center" VerticalAlignment="Center" Grid.Row="1" ><Run Text="«"/></TextBlock>
                <TextBlock VerticalAlignment="Center" Grid.Column="1" Grid.Row="1" Margin="3,5,3,0" x:Name="lCaption" FontSize="10.667" HorizontalAlignment="Center" TextTrimming="WordEllipsis" d:LayoutOverrides="Height"><Run Text="caption"/></TextBlock>
                <TextBlock FontSize="21.333" Grid.Column="2" Margin="0,3,1,0" x:Name="lRight" VerticalAlignment="Center" HorizontalAlignment="Center" Grid.Row="1"><Run Text="»"/></TextBlock>
            </Grid>
        </Border>
        <Border x:Name="border1" BorderThickness="0" Background="#FF444E89" Margin="2" VerticalAlignment="Top" Height="4" Opacity="0.645"/>
        
    </Grid>
</UserControl>
